{%- set separator = ' ' -%}
{{ pillar['headers']['multiline'] -}}
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user    command
{%- for job in jobs %}
{% if job.execution == "exactly" -%}
{% if job.everynminute | to_bool %}*/{{ job.minute }}{% else %}{{ job.minute }}{% endif -%}
{{ separator }}{% if job.everynhour | to_bool %}*/{{ job.hour }}{% else %}{{ job.hour }}{% endif -%}
{{ separator }}{% if job.everyndayofmonth | to_bool %}*/{{ job.dayofmonth }}{% else %}{{ job.dayofmonth }}{% endif -%}
{{ separator }}{{ job.month }}{{ separator }}{{ job.dayofweek }}
{%- else -%}
@{{ job.execution }}
{%- endif -%}
{{ separator }}{{ job.username }}{{ separator }}{{ 'systemctl ' + (job.type | replace('shutdown', 'poweroff') | replace('standby', config.standbymode) | replace('suspendhybrid', 'hybrid-sleep')) }} >/dev/null 2>&1
{%- endfor -%}
